package com.zoffy.ybuhelper.util;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

import java.io.IOException;

public class HttpUtil {
    public static HttpResponse login(String account,String password) throws IOException {
        CloseableHttpClient httpClient= HttpClients.createDefault();
        HttpPost httpost=new HttpPost("http://jwxt.ybu.edu.cn/jsxsd/xk/LoginToXkLdap?userPassword=&" +
                "userAccount="+account+
                "&encoded="+Base64Util.encode(account) +"%25%25%25"+Base64Util.encode(password));
                return httpClient.execute(httpost);
    }
}
